use "C:\Users\user\Documents\My work\연구\Police and human rights\Policing and Society\dataset_ver06.dta", clear

gen lpol_pop=l.pol_pop
xtset cow year
ologit physint l.physint c.l.pol_pop##c.efindex##c.polity2 y2003 y2004 y2005 y2006 y2007 y2008 y2009 y2010 y2011 y2012 y2013 if polity2>6, robust cluster(cow) 
outreg2 using "C:\Users\user\Documents\My work\연구\Police and human rights\table1", word replace dec(2) symbol(**, *, †)
ologit physint l.physint c.l.pol_pop##c.efindex##c.polity2 l_gdp_pc c.state_capacity battle_death igo iccpr y2003 y2004 y2005 y2006 y2007 y2008 y2009 y2010 y2011 y2012 y2013 if polity2>6, robust cluster(cow) 
outreg2 using "C:\Users\user\Documents\My work\연구\Police and human rights\table1", word append dec(2) symbol(**, *, †)

**robustness checks**
xtreg physint l.physint c.l.pol_pop##c.efindex##c.polity2 l_gdp_pc c.state_capacity battle_death igo iccpr y2003 y2004 y2005 y2006 y2007 y2008 y2009 y2010 y2011 y2012 y2013 if polity2>6, fe 
estimates store fixed
xtreg physint l.physint c.l.pol_pop##c.efindex##c.polity2 l_gdp_pc c.state_capacity battle_death igo iccpr y2003 y2004 y2005 y2006 y2007 y2008 y2009 y2010 y2011 y2012 y2013 if polity2>6, re
estimates store random
hausman fixed random
//should use random effects


**Instrumental Variable Analyses**

gen interaction=pol_pop*efindex
gen interaction_iv=l.hom_pop*efindex
gen interaction2=pol_pop*polity2
gen interaction2_iv=l.hom_pop*polity2
gen interaction3=pol_pop*efindex*polity2
gen interaction3_iv=l.hom_pop*efindex*polity2
gen interaction4=polity2*efindex
xtset cow year
ivreg2 physint l.physint pol_pop efindex interaction interaction2 interaction3 interaction4 polity2 l_gdp_pc state_capacity battle_death igo iccpr y2003 y2004 y2005 y2006 y2007 y2008 y2009 y2010 y2011 y2012 y2013 (pol_pop interaction interaction2 interaction3= l.hom_pop interaction_iv interaction2_iv interaction3_iv) if polity2>6, robust cluster(cow)
outreg2 using "C:\Users\user\Documents\My work\연구\Police and human rights\table3", word append dec(2) symbol(**, *, †)
